<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - Lua 5.2.4 - src/llex.c</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - llex.c</td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">Lua 5.2.4</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">288</td>
            <td class="headerCovTableEntry">293</td>
            <td class="headerCovTableEntryHi">98.3 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2019-06-13 19:44:16</td>
            <td></td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<span class="lineNum">       1 </span>            : /*
<span class="lineNum">       2 </span>            : ** $Id: llex.c,v 2.63.1.3 2015/02/09 17:56:34 roberto Exp $
<span class="lineNum">       3 </span>            : ** Lexical Analyzer
<span class="lineNum">       4 </span>            : ** See Copyright Notice in lua.h
<span class="lineNum">       5 </span>            : */
<span class="lineNum">       6 </span>            : 
<span class="lineNum">       7 </span>            : 
<span class="lineNum">       8 </span>            : #include &lt;locale.h&gt;
<span class="lineNum">       9 </span>            : #include &lt;string.h&gt;
<span class="lineNum">      10 </span>            : 
<span class="lineNum">      11 </span>            : #define llex_c
<span class="lineNum">      12 </span>            : #define LUA_CORE
<span class="lineNum">      13 </span>            : 
<span class="lineNum">      14 </span>            : #include &quot;lua.h&quot;
<span class="lineNum">      15 </span>            : 
<span class="lineNum">      16 </span>            : #include &quot;lctype.h&quot;
<span class="lineNum">      17 </span>            : #include &quot;ldo.h&quot;
<span class="lineNum">      18 </span>            : #include &quot;llex.h&quot;
<span class="lineNum">      19 </span>            : #include &quot;lobject.h&quot;
<span class="lineNum">      20 </span>            : #include &quot;lparser.h&quot;
<span class="lineNum">      21 </span>            : #include &quot;lstate.h&quot;
<span class="lineNum">      22 </span>            : #include &quot;lstring.h&quot;
<span class="lineNum">      23 </span>            : #include &quot;ltable.h&quot;
<span class="lineNum">      24 </span>            : #include &quot;lzio.h&quot;
<span class="lineNum">      25 </span>            : 
<span class="lineNum">      26 </span>            : 
<span class="lineNum">      27 </span>            : 
<span class="lineNum">      28 </span>            : #define next(ls) (ls-&gt;current = zgetc(ls-&gt;z))
<span class="lineNum">      29 </span>            : 
<span class="lineNum">      30 </span>            : 
<span class="lineNum">      31 </span>            : 
<span class="lineNum">      32 </span>            : #define currIsNewline(ls)       (ls-&gt;current == '\n' || ls-&gt;current == '\r')
<span class="lineNum">      33 </span>            : 
<span class="lineNum">      34 </span>            : 
<span class="lineNum">      35 </span>            : /* ORDER RESERVED */
<span class="lineNum">      36 </span>            : static const char *const luaX_tokens [] = {
<span class="lineNum">      37 </span>            :     &quot;and&quot;, &quot;break&quot;, &quot;do&quot;, &quot;else&quot;, &quot;elseif&quot;,
<span class="lineNum">      38 </span>            :     &quot;end&quot;, &quot;false&quot;, &quot;for&quot;, &quot;function&quot;, &quot;goto&quot;, &quot;if&quot;,
<span class="lineNum">      39 </span>            :     &quot;in&quot;, &quot;local&quot;, &quot;nil&quot;, &quot;not&quot;, &quot;or&quot;, &quot;repeat&quot;,
<span class="lineNum">      40 </span>            :     &quot;return&quot;, &quot;then&quot;, &quot;true&quot;, &quot;until&quot;, &quot;while&quot;,
<span class="lineNum">      41 </span>            :     &quot;..&quot;, &quot;...&quot;, &quot;==&quot;, &quot;&gt;=&quot;, &quot;&lt;=&quot;, &quot;~=&quot;, &quot;::&quot;, &quot;&lt;eof&gt;&quot;,
<span class="lineNum">      42 </span>            :     &quot;&lt;number&gt;&quot;, &quot;&lt;name&gt;&quot;, &quot;&lt;string&gt;&quot;
<span class="lineNum">      43 </span>            : };
<span class="lineNum">      44 </span>            : 
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span>            : #define save_and_next(ls) (save(ls, ls-&gt;current), next(ls))
<span class="lineNum">      47 </span>            : 
<span class="lineNum">      48 </span>            : 
<span class="lineNum">      49 </span>            : static l_noret lexerror (LexState *ls, const char *msg, int token);
<span class="lineNum">      50 </span>            : 
<span class="lineNum">      51 </span>            : 
<span class="lineNum">      52 </span><span class="lineCov">     271318 : static void save (LexState *ls, int c) {</span>
<span class="lineNum">      53 </span><span class="lineCov">     271318 :   Mbuffer *b = ls-&gt;buff;</span>
<span class="lineNum">      54 </span><span class="lineCov">     271318 :   if (luaZ_bufflen(b) + 1 &gt; luaZ_sizebuffer(b)) {</span>
<span class="lineNum">      55 </span>            :     size_t newsize;
<span class="lineNum">      56 </span><span class="lineCov">         58 :     if (luaZ_sizebuffer(b) &gt;= MAX_SIZET/2)</span>
<span class="lineNum">      57 </span><span class="lineNoCov">          0 :       lexerror(ls, &quot;lexical element too long&quot;, 0);</span>
<span class="lineNum">      58 </span><span class="lineCov">         58 :     newsize = luaZ_sizebuffer(b) * 2;</span>
<span class="lineNum">      59 </span><span class="lineCov">         58 :     luaZ_resizebuffer(ls-&gt;L, b, newsize);</span>
<span class="lineNum">      60 </span>            :   }
<span class="lineNum">      61 </span><span class="lineCov">     271318 :   b-&gt;buffer[luaZ_bufflen(b)++] = cast(char, c);</span>
<span class="lineNum">      62 </span><span class="lineCov">     271318 : }</span>
<span class="lineNum">      63 </span>            : 
<span class="lineNum">      64 </span>            : 
<span class="lineNum">      65 </span><span class="lineCov">        108 : void luaX_init (lua_State *L) {</span>
<span class="lineNum">      66 </span>            :   int i;
<span class="lineNum">      67 </span><span class="lineCov">       2484 :   for (i=0; i&lt;NUM_RESERVED; i++) {</span>
<span class="lineNum">      68 </span><span class="lineCov">       2376 :     TString *ts = luaS_new(L, luaX_tokens[i]);</span>
<span class="lineNum">      69 </span><span class="lineCov">       2376 :     luaS_fix(ts);  /* reserved words are never collected */</span>
<span class="lineNum">      70 </span><span class="lineCov">       2376 :     ts-&gt;tsv.extra = cast_byte(i+1);  /* reserved word */</span>
<span class="lineNum">      71 </span>            :   }
<span class="lineNum">      72 </span><span class="lineCov">        108 : }</span>
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span>            : 
<span class="lineNum">      75 </span><span class="lineCov">         35 : const char *luaX_token2str (LexState *ls, int token) {</span>
<span class="lineNum">      76 </span><span class="lineCov">         35 :   if (token &lt; FIRST_RESERVED) {  /* single-byte symbols? */</span>
<span class="lineNum">      77 </span>            :     lua_assert(token == cast(unsigned char, token));
<span class="lineNum">      78 </span><span class="lineCov">         13 :     return (lisprint(token)) ? luaO_pushfstring(ls-&gt;L, LUA_QL(&quot;%c&quot;), token) :</span>
<span class="lineNum">      79 </span><span class="lineNoCov">          0 :                               luaO_pushfstring(ls-&gt;L, &quot;char(%d)&quot;, token);</span>
<span class="lineNum">      80 </span>            :   }
<span class="lineNum">      81 </span>            :   else {
<span class="lineNum">      82 </span><span class="lineCov">         22 :     const char *s = luaX_tokens[token - FIRST_RESERVED];</span>
<span class="lineNum">      83 </span><span class="lineCov">         22 :     if (token &lt; TK_EOS)  /* fixed format (symbols and reserved words)? */</span>
<span class="lineNum">      84 </span><span class="lineCov">         11 :       return luaO_pushfstring(ls-&gt;L, LUA_QS, s);</span>
<span class="lineNum">      85 </span>            :     else  /* names, strings, and numerals */
<span class="lineNum">      86 </span><span class="lineCov">         11 :       return s;</span>
<span class="lineNum">      87 </span>            :   }
<span class="lineNum">      88 </span>            : }
<span class="lineNum">      89 </span>            : 
<span class="lineNum">      90 </span>            : 
<span class="lineNum">      91 </span><span class="lineCov">         34 : static const char *txtToken (LexState *ls, int token) {</span>
<span class="lineNum">      92 </span><span class="lineCov">         34 :   switch (token) {</span>
<span class="lineNum">      93 </span><span class="lineCov">         11 :     case TK_NAME:</span>
<span class="lineNum">      94 </span>            :     case TK_STRING:
<span class="lineNum">      95 </span>            :     case TK_NUMBER:
<span class="lineNum">      96 </span><span class="lineCov">         11 :       save(ls, '\0');</span>
<span class="lineNum">      97 </span><span class="lineCov">         11 :       return luaO_pushfstring(ls-&gt;L, LUA_QS, luaZ_buffer(ls-&gt;buff));</span>
<span class="lineNum">      98 </span><span class="lineCov">         23 :     default:</span>
<span class="lineNum">      99 </span><span class="lineCov">         23 :       return luaX_token2str(ls, token);</span>
<span class="lineNum">     100 </span>            :   }
<span class="lineNum">     101 </span>            : }
<span class="lineNum">     102 </span>            : 
<span class="lineNum">     103 </span>            : 
<span class="lineNum">     104 </span><span class="lineCov">         38 : static l_noret lexerror (LexState *ls, const char *msg, int token) {</span>
<span class="lineNum">     105 </span>            :   char buff[LUA_IDSIZE];
<span class="lineNum">     106 </span><span class="lineCov">         38 :   luaO_chunkid(buff, getstr(ls-&gt;source), LUA_IDSIZE);</span>
<span class="lineNum">     107 </span><span class="lineCov">         38 :   msg = luaO_pushfstring(ls-&gt;L, &quot;%s:%d: %s&quot;, buff, ls-&gt;linenumber, msg);</span>
<span class="lineNum">     108 </span><span class="lineCov">         38 :   if (token)</span>
<span class="lineNum">     109 </span><span class="lineCov">         34 :     luaO_pushfstring(ls-&gt;L, &quot;%s near %s&quot;, msg, txtToken(ls, token));</span>
<span class="lineNum">     110 </span><span class="lineCov">         38 :   luaD_throw(ls-&gt;L, LUA_ERRSYNTAX);</span>
<span class="lineNum">     111 </span>            : }
<span class="lineNum">     112 </span>            : 
<span class="lineNum">     113 </span>            : 
<span class="lineNum">     114 </span><span class="lineCov">         26 : l_noret luaX_syntaxerror (LexState *ls, const char *msg) {</span>
<span class="lineNum">     115 </span><span class="lineCov">         26 :   lexerror(ls, msg, ls-&gt;t.token);</span>
<span class="lineNum">     116 </span>            : }
<span class="lineNum">     117 </span>            : 
<span class="lineNum">     118 </span>            : 
<span class="lineNum">     119 </span>            : /*
<span class="lineNum">     120 </span>            : ** creates a new string and anchors it in function's table so that
<span class="lineNum">     121 </span>            : ** it will not be collected until the end of the function's compilation
<span class="lineNum">     122 </span>            : ** (by that time it should be anchored in function's prototype)
<span class="lineNum">     123 </span>            : */
<span class="lineNum">     124 </span><span class="lineCov">      46884 : TString *luaX_newstring (LexState *ls, const char *str, size_t l) {</span>
<span class="lineNum">     125 </span><span class="lineCov">      46884 :   lua_State *L = ls-&gt;L;</span>
<span class="lineNum">     126 </span>            :   TValue *o;  /* entry for `str' */
<span class="lineNum">     127 </span><span class="lineCov">      46884 :   TString *ts = luaS_newlstr(L, str, l);  /* create new string */</span>
<span class="lineNum">     128 </span><span class="lineCov">      46884 :   setsvalue2s(L, L-&gt;top++, ts);  /* temporarily anchor it in stack */</span>
<span class="lineNum">     129 </span><span class="lineCov">      46884 :   o = luaH_set(L, ls-&gt;fs-&gt;h, L-&gt;top - 1);</span>
<span class="lineNum">     130 </span><span class="lineCov">      46884 :   if (ttisnil(o)) {  /* not in use yet? (see 'addK') */</span>
<span class="lineNum">     131 </span>            :     /* boolean value does not need GC barrier;
<span class="lineNum">     132 </span>            :        table has no metatable, so it does not need to invalidate cache */
<span class="lineNum">     133 </span><span class="lineCov">      23817 :     setbvalue(o, 1);  /* t[string] = true */</span>
<span class="lineNum">     134 </span><span class="lineCov">      23817 :     luaC_checkGC(L);</span>
<span class="lineNum">     135 </span>            :   }
<span class="lineNum">     136 </span>            :   else {  /* string already present */
<span class="lineNum">     137 </span><span class="lineCov">      23067 :     ts = rawtsvalue(keyfromval(o));  /* re-use value previously stored */</span>
<span class="lineNum">     138 </span>            :   }
<span class="lineNum">     139 </span><span class="lineCov">      46884 :   L-&gt;top--;  /* remove string from stack */</span>
<span class="lineNum">     140 </span><span class="lineCov">      46884 :   return ts;</span>
<span class="lineNum">     141 </span>            : }
<span class="lineNum">     142 </span>            : 
<span class="lineNum">     143 </span>            : 
<span class="lineNum">     144 </span>            : /*
<span class="lineNum">     145 </span>            : ** increment line number and skips newline sequence (any of
<span class="lineNum">     146 </span>            : ** \n, \r, \n\r, or \r\n)
<span class="lineNum">     147 </span>            : */
<span class="lineNum">     148 </span><span class="lineCov">      22373 : static void inclinenumber (LexState *ls) {</span>
<span class="lineNum">     149 </span><span class="lineCov">      22373 :   int old = ls-&gt;current;</span>
<span class="lineNum">     150 </span>            :   lua_assert(currIsNewline(ls));
<span class="lineNum">     151 </span><span class="lineCov">      22373 :   next(ls);  /* skip `\n' or `\r' */</span>
<span class="lineNum">     152 </span><span class="lineCov">      22373 :   if (currIsNewline(ls) &amp;&amp; ls-&gt;current != old)</span>
<span class="lineNum">     153 </span><span class="lineNoCov">          0 :     next(ls);  /* skip `\n\r' or `\r\n' */</span>
<span class="lineNum">     154 </span><span class="lineCov">      22373 :   if (++ls-&gt;linenumber &gt;= MAX_INT)</span>
<span class="lineNum">     155 </span><span class="lineNoCov">          0 :     lexerror(ls, &quot;chunk has too many lines&quot;, 0);</span>
<span class="lineNum">     156 </span><span class="lineCov">      22373 : }</span>
<span class="lineNum">     157 </span>            : 
<span class="lineNum">     158 </span>            : 
<span class="lineNum">     159 </span><span class="lineCov">        493 : void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source,</span>
<span class="lineNum">     160 </span>            :                     int firstchar) {
<span class="lineNum">     161 </span><span class="lineCov">        493 :   ls-&gt;decpoint = '.';</span>
<span class="lineNum">     162 </span><span class="lineCov">        493 :   ls-&gt;L = L;</span>
<span class="lineNum">     163 </span><span class="lineCov">        493 :   ls-&gt;current = firstchar;</span>
<span class="lineNum">     164 </span><span class="lineCov">        493 :   ls-&gt;lookahead.token = TK_EOS;  /* no look-ahead token */</span>
<span class="lineNum">     165 </span><span class="lineCov">        493 :   ls-&gt;z = z;</span>
<span class="lineNum">     166 </span><span class="lineCov">        493 :   ls-&gt;fs = NULL;</span>
<span class="lineNum">     167 </span><span class="lineCov">        493 :   ls-&gt;linenumber = 1;</span>
<span class="lineNum">     168 </span><span class="lineCov">        493 :   ls-&gt;lastline = 1;</span>
<span class="lineNum">     169 </span><span class="lineCov">        493 :   ls-&gt;source = source;</span>
<span class="lineNum">     170 </span><span class="lineCov">        493 :   ls-&gt;envn = luaS_new(L, LUA_ENV);  /* create env name */</span>
<span class="lineNum">     171 </span><span class="lineCov">        493 :   luaS_fix(ls-&gt;envn);  /* never collect this name */</span>
<span class="lineNum">     172 </span><span class="lineCov">        493 :   luaZ_resizebuffer(ls-&gt;L, ls-&gt;buff, LUA_MINBUFFER);  /* initialize buffer */</span>
<span class="lineNum">     173 </span><span class="lineCov">        493 : }</span>
<span class="lineNum">     174 </span>            : 
<span class="lineNum">     175 </span>            : 
<span class="lineNum">     176 </span>            : 
<span class="lineNum">     177 </span>            : /*
<span class="lineNum">     178 </span>            : ** =======================================================
<span class="lineNum">     179 </span>            : ** LEXICAL ANALYZER
<span class="lineNum">     180 </span>            : ** =======================================================
<span class="lineNum">     181 </span>            : */
<span class="lineNum">     182 </span>            : 
<span class="lineNum">     183 </span>            : 
<span class="lineNum">     184 </span>            : 
<span class="lineNum">     185 </span><span class="lineCov">      10938 : static int check_next (LexState *ls, const char *set) {</span>
<span class="lineNum">     186 </span><span class="lineCov">      10938 :   if (ls-&gt;current == '\0' || !strchr(set, ls-&gt;current))</span>
<span class="lineNum">     187 </span><span class="lineCov">       8942 :     return 0;</span>
<span class="lineNum">     188 </span><span class="lineCov">       1996 :   save_and_next(ls);</span>
<span class="lineNum">     189 </span><span class="lineCov">       1996 :   return 1;</span>
<span class="lineNum">     190 </span>            : }
<span class="lineNum">     191 </span>            : 
<span class="lineNum">     192 </span>            : 
<span class="lineNum">     193 </span>            : /*
<span class="lineNum">     194 </span>            : ** change all characters 'from' in buffer to 'to'
<span class="lineNum">     195 </span>            : */
<span class="lineNum">     196 </span><span class="lineCov">       3095 : static void buffreplace (LexState *ls, char from, char to) {</span>
<span class="lineNum">     197 </span><span class="lineCov">       3095 :   size_t n = luaZ_bufflen(ls-&gt;buff);</span>
<span class="lineNum">     198 </span><span class="lineCov">       3095 :   char *p = luaZ_buffer(ls-&gt;buff);</span>
<span class="lineNum">     199 </span><span class="lineCov">      10728 :   while (n--)</span>
<span class="lineNum">     200 </span><span class="lineCov">       7633 :     if (p[n] == from) p[n] = to;</span>
<span class="lineNum">     201 </span><span class="lineCov">       3095 : }</span>
<span class="lineNum">     202 </span>            : 
<span class="lineNum">     203 </span>            : 
<span class="lineNum">     204 </span>            : #if !defined(getlocaledecpoint)
<span class="lineNum">     205 </span>            : #define getlocaledecpoint()     (localeconv()-&gt;decimal_point[0])
<span class="lineNum">     206 </span>            : #endif
<span class="lineNum">     207 </span>            : 
<span class="lineNum">     208 </span>            : 
<span class="lineNum">     209 </span>            : #define buff2d(b,e)     luaO_str2d(luaZ_buffer(b), luaZ_bufflen(b) - 1, e)
<span class="lineNum">     210 </span>            : 
<span class="lineNum">     211 </span>            : /*
<span class="lineNum">     212 </span>            : ** in case of format error, try to change decimal point separator to
<span class="lineNum">     213 </span>            : ** the one defined in the current locale and check again
<span class="lineNum">     214 </span>            : */
<span class="lineNum">     215 </span><span class="lineCov">          1 : static void trydecpoint (LexState *ls, SemInfo *seminfo) {</span>
<span class="lineNum">     216 </span><span class="lineCov">          1 :   char old = ls-&gt;decpoint;</span>
<span class="lineNum">     217 </span><span class="lineCov">          1 :   ls-&gt;decpoint = getlocaledecpoint();</span>
<span class="lineNum">     218 </span><span class="lineCov">          1 :   buffreplace(ls, old, ls-&gt;decpoint);  /* try new decimal separator */</span>
<span class="lineNum">     219 </span><span class="lineCov">          1 :   if (!buff2d(ls-&gt;buff, &amp;seminfo-&gt;r)) {</span>
<span class="lineNum">     220 </span>            :     /* format error with correct decimal point: no more options */
<span class="lineNum">     221 </span><span class="lineCov">          1 :     buffreplace(ls, ls-&gt;decpoint, '.');  /* undo change (for error message) */</span>
<span class="lineNum">     222 </span><span class="lineCov">          1 :     lexerror(ls, &quot;malformed number&quot;, TK_NUMBER);</span>
<span class="lineNum">     223 </span>            :   }
<span class="lineNum">     224 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     225 </span>            : 
<span class="lineNum">     226 </span>            : 
<span class="lineNum">     227 </span>            : /* LUA_NUMBER */
<span class="lineNum">     228 </span>            : /*
<span class="lineNum">     229 </span>            : ** this function is quite liberal in what it accepts, as 'luaO_str2d'
<span class="lineNum">     230 </span>            : ** will reject ill-formed numerals.
<span class="lineNum">     231 </span>            : */
<span class="lineNum">     232 </span><span class="lineCov">       3093 : static void read_numeral (LexState *ls, SemInfo *seminfo) {</span>
<span class="lineNum">     233 </span><span class="lineCov">       3093 :   const char *expo = &quot;Ee&quot;;</span>
<span class="lineNum">     234 </span><span class="lineCov">       3093 :   int first = ls-&gt;current;</span>
<span class="lineNum">     235 </span>            :   lua_assert(lisdigit(ls-&gt;current));
<span class="lineNum">     236 </span><span class="lineCov">       3093 :   save_and_next(ls);</span>
<span class="lineNum">     237 </span><span class="lineCov">       3093 :   if (first == '0' &amp;&amp; check_next(ls, &quot;Xx&quot;))  /* hexadecimal? */</span>
<span class="lineNum">     238 </span><span class="lineCov">         82 :     expo = &quot;Pp&quot;;</span>
<span class="lineNum">     239 </span>            :   for (;;) {
<span class="lineNum">     240 </span><span class="lineCov">       4426 :     if (check_next(ls, expo))  /* exponent part? */</span>
<span class="lineNum">     241 </span><span class="lineCov">         10 :       check_next(ls, &quot;+-&quot;);  /* optional exponent sign */</span>
<span class="lineNum">     242 </span><span class="lineCov">       4426 :     if (lisxdigit(ls-&gt;current) || ls-&gt;current == '.')</span>
<span class="lineNum">     243 </span><span class="lineCov">       1333 :       save_and_next(ls);</span>
<span class="lineNum">     244 </span>            :     else  break;
<span class="lineNum">     245 </span>            :   }
<span class="lineNum">     246 </span><span class="lineCov">       3093 :   save(ls, '\0');</span>
<span class="lineNum">     247 </span><span class="lineCov">       3093 :   buffreplace(ls, '.', ls-&gt;decpoint);  /* follow locale for decimal point */</span>
<span class="lineNum">     248 </span><span class="lineCov">       3093 :   if (!buff2d(ls-&gt;buff, &amp;seminfo-&gt;r))  /* format error? */</span>
<span class="lineNum">     249 </span><span class="lineCov">          1 :     trydecpoint(ls, seminfo); /* try to update decimal point separator */</span>
<span class="lineNum">     250 </span><span class="lineCov">       3092 : }</span>
<span class="lineNum">     251 </span>            : 
<span class="lineNum">     252 </span>            : 
<span class="lineNum">     253 </span>            : /*
<span class="lineNum">     254 </span>            : ** skip a sequence '[=*[' or ']=*]' and return its number of '='s or
<span class="lineNum">     255 </span>            : ** -1 if sequence is malformed
<span class="lineNum">     256 </span>            : */
<span class="lineNum">     257 </span><span class="lineCov">       1827 : static int skip_sep (LexState *ls) {</span>
<span class="lineNum">     258 </span><span class="lineCov">       1827 :   int count = 0;</span>
<span class="lineNum">     259 </span><span class="lineCov">       1827 :   int s = ls-&gt;current;</span>
<span class="lineNum">     260 </span>            :   lua_assert(s == '[' || s == ']');
<span class="lineNum">     261 </span><span class="lineCov">       1827 :   save_and_next(ls);</span>
<span class="lineNum">     262 </span><span class="lineCov">       1840 :   while (ls-&gt;current == '=') {</span>
<span class="lineNum">     263 </span><span class="lineCov">         13 :     save_and_next(ls);</span>
<span class="lineNum">     264 </span><span class="lineCov">         13 :     count++;</span>
<span class="lineNum">     265 </span>            :   }
<span class="lineNum">     266 </span><span class="lineCov">       1827 :   return (ls-&gt;current == s) ? count : (-count) - 1;</span>
<span class="lineNum">     267 </span>            : }
<span class="lineNum">     268 </span>            : 
<span class="lineNum">     269 </span>            : 
<span class="lineNum">     270 </span><span class="lineCov">        583 : static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {</span>
<span class="lineNum">     271 </span><span class="lineCov">        583 :   save_and_next(ls);  /* skip 2nd `[' */</span>
<span class="lineNum">     272 </span><span class="lineCov">        583 :   if (currIsNewline(ls))  /* string starts with a newline? */</span>
<span class="lineNum">     273 </span><span class="lineCov">        219 :     inclinenumber(ls);  /* skip it */</span>
<span class="lineNum">     274 </span>            :   for (;;) {
<span class="lineNum">     275 </span><span class="lineCov">      41018 :     switch (ls-&gt;current) {</span>
<span class="lineNum">     276 </span><span class="lineCov">          2 :       case EOZ:</span>
<span class="lineNum">     277 </span><span class="lineCov">          2 :         lexerror(ls, (seminfo) ? &quot;unfinished long string&quot; :</span>
<span class="lineNum">     278 </span>            :                                  &quot;unfinished long comment&quot;, TK_EOS);
<span class="lineNum">     279 </span>            :         break;  /* to avoid warnings */
<span class="lineNum">     280 </span><span class="lineCov">        588 :       case ']': {</span>
<span class="lineNum">     281 </span><span class="lineCov">        588 :         if (skip_sep(ls) == sep) {</span>
<span class="lineNum">     282 </span><span class="lineCov">        581 :           save_and_next(ls);  /* skip 2nd `]' */</span>
<span class="lineNum">     283 </span><span class="lineCov">        581 :           goto endloop;</span>
<span class="lineNum">     284 </span>            :         }
<span class="lineNum">     285 </span><span class="lineCov">          7 :         break;</span>
<span class="lineNum">     286 </span>            :       }
<span class="lineNum">     287 </span><span class="lineCov">       1810 :       case '\n': case '\r': {</span>
<span class="lineNum">     288 </span><span class="lineCov">       1810 :         save(ls, '\n');</span>
<span class="lineNum">     289 </span><span class="lineCov">       1810 :         inclinenumber(ls);</span>
<span class="lineNum">     290 </span><span class="lineCov">       1810 :         if (!seminfo) luaZ_resetbuffer(ls-&gt;buff);  /* avoid wasting space */</span>
<span class="lineNum">     291 </span><span class="lineCov">       1810 :         break;</span>
<span class="lineNum">     292 </span>            :       }
<span class="lineNum">     293 </span><span class="lineCov">      38618 :       default: {</span>
<span class="lineNum">     294 </span><span class="lineCov">      38618 :         if (seminfo) save_and_next(ls);</span>
<span class="lineNum">     295 </span><span class="lineCov">      32957 :         else next(ls);</span>
<span class="lineNum">     296 </span>            :       }
<span class="lineNum">     297 </span>            :     }
<span class="lineNum">     298 </span><span class="lineCov">        581 :   } endloop:</span>
<span class="lineNum">     299 </span><span class="lineCov">        581 :   if (seminfo)</span>
<span class="lineNum">     300 </span><span class="lineCov">        148 :     seminfo-&gt;ts = luaX_newstring(ls, luaZ_buffer(ls-&gt;buff) + (2 + sep),</span>
<span class="lineNum">     301 </span><span class="lineCov">        148 :                                      luaZ_bufflen(ls-&gt;buff) - 2*(2 + sep));</span>
<span class="lineNum">     302 </span><span class="lineCov">        581 : }</span>
<span class="lineNum">     303 </span>            : 
<span class="lineNum">     304 </span>            : 
<span class="lineNum">     305 </span><span class="lineCov">          3 : static void escerror (LexState *ls, int *c, int n, const char *msg) {</span>
<span class="lineNum">     306 </span>            :   int i;
<span class="lineNum">     307 </span><span class="lineCov">          3 :   luaZ_resetbuffer(ls-&gt;buff);  /* prepare error message */</span>
<span class="lineNum">     308 </span><span class="lineCov">          3 :   save(ls, '\\');</span>
<span class="lineNum">     309 </span><span class="lineCov">          9 :   for (i = 0; i &lt; n &amp;&amp; c[i] != EOZ; i++)</span>
<span class="lineNum">     310 </span><span class="lineCov">          6 :     save(ls, c[i]);</span>
<span class="lineNum">     311 </span><span class="lineCov">          3 :   lexerror(ls, msg, TK_STRING);</span>
<span class="lineNum">     312 </span>            : }
<span class="lineNum">     313 </span>            : 
<span class="lineNum">     314 </span>            : 
<span class="lineNum">     315 </span><span class="lineCov">         43 : static int readhexaesc (LexState *ls) {</span>
<span class="lineNum">     316 </span>            :   int c[3], i;  /* keep input for error message */
<span class="lineNum">     317 </span><span class="lineCov">         43 :   int r = 0;  /* result accumulator */</span>
<span class="lineNum">     318 </span><span class="lineCov">         43 :   c[0] = 'x';  /* for error message */</span>
<span class="lineNum">     319 </span><span class="lineCov">        127 :   for (i = 1; i &lt; 3; i++) {  /* read two hexadecimal digits */</span>
<span class="lineNum">     320 </span><span class="lineCov">         85 :     c[i] = next(ls);</span>
<span class="lineNum">     321 </span><span class="lineCov">         85 :     if (!lisxdigit(c[i]))</span>
<span class="lineNum">     322 </span><span class="lineCov">          1 :       escerror(ls, c, i + 1, &quot;hexadecimal digit expected&quot;);</span>
<span class="lineNum">     323 </span><span class="lineCov">         84 :     r = (r &lt;&lt; 4) + luaO_hexavalue(c[i]);</span>
<span class="lineNum">     324 </span>            :   }
<span class="lineNum">     325 </span><span class="lineCov">         42 :   return r;</span>
<span class="lineNum">     326 </span>            : }
<span class="lineNum">     327 </span>            : 
<span class="lineNum">     328 </span>            : 
<span class="lineNum">     329 </span><span class="lineCov">         63 : static int readdecesc (LexState *ls) {</span>
<span class="lineNum">     330 </span>            :   int c[3], i;
<span class="lineNum">     331 </span><span class="lineCov">         63 :   int r = 0;  /* result accumulator */</span>
<span class="lineNum">     332 </span><span class="lineCov">        168 :   for (i = 0; i &lt; 3 &amp;&amp; lisdigit(ls-&gt;current); i++) {  /* read up to 3 digits */</span>
<span class="lineNum">     333 </span><span class="lineCov">        105 :     c[i] = ls-&gt;current;</span>
<span class="lineNum">     334 </span><span class="lineCov">        105 :     r = 10*r + c[i] - '0';</span>
<span class="lineNum">     335 </span><span class="lineCov">        105 :     next(ls);</span>
<span class="lineNum">     336 </span>            :   }
<span class="lineNum">     337 </span><span class="lineCov">         63 :   if (r &gt; UCHAR_MAX)</span>
<span class="lineNum">     338 </span><span class="lineCov">          1 :     escerror(ls, c, i, &quot;decimal escape too large&quot;);</span>
<span class="lineNum">     339 </span><span class="lineCov">         62 :   return r;</span>
<span class="lineNum">     340 </span>            : }
<span class="lineNum">     341 </span>            : 
<span class="lineNum">     342 </span>            : 
<span class="lineNum">     343 </span><span class="lineCov">       6437 : static void read_string (LexState *ls, int del, SemInfo *seminfo) {</span>
<span class="lineNum">     344 </span><span class="lineCov">       6437 :   save_and_next(ls);  /* keep delimiter (for error messages) */</span>
<span class="lineNum">     345 </span><span class="lineCov">      74566 :   while (ls-&gt;current != del) {</span>
<span class="lineNum">     346 </span><span class="lineCov">      68137 :     switch (ls-&gt;current) {</span>
<span class="lineNum">     347 </span><span class="lineCov">          3 :       case EOZ:</span>
<span class="lineNum">     348 </span><span class="lineCov">          3 :         lexerror(ls, &quot;unfinished string&quot;, TK_EOS);</span>
<span class="lineNum">     349 </span>            :         break;  /* to avoid warnings */
<span class="lineNum">     350 </span><span class="lineCov">          2 :       case '\n':</span>
<span class="lineNum">     351 </span>            :       case '\r':
<span class="lineNum">     352 </span><span class="lineCov">          2 :         lexerror(ls, &quot;unfinished string&quot;, TK_STRING);</span>
<span class="lineNum">     353 </span>            :         break;  /* to avoid warnings */
<span class="lineNum">     354 </span><span class="lineCov">        429 :       case '\\': {  /* escape sequences */</span>
<span class="lineNum">     355 </span>            :         int c;  /* final character to be saved */
<span class="lineNum">     356 </span><span class="lineCov">        429 :         next(ls);  /* do not save the `\' */</span>
<span class="lineNum">     357 </span><span class="lineCov">        429 :         switch (ls-&gt;current) {</span>
<span class="lineNum">     358 </span><span class="lineCov">          2 :           case 'a': c = '\a'; goto read_save;</span>
<span class="lineNum">     359 </span><span class="lineCov">          8 :           case 'b': c = '\b'; goto read_save;</span>
<span class="lineNum">     360 </span><span class="lineCov">         12 :           case 'f': c = '\f'; goto read_save;</span>
<span class="lineNum">     361 </span><span class="lineCov">         59 :           case 'n': c = '\n'; goto read_save;</span>
<span class="lineNum">     362 </span><span class="lineCov">         17 :           case 'r': c = '\r'; goto read_save;</span>
<span class="lineNum">     363 </span><span class="lineCov">        182 :           case 't': c = '\t'; goto read_save;</span>
<span class="lineNum">     364 </span><span class="lineCov">          2 :           case 'v': c = '\v'; goto read_save;</span>
<span class="lineNum">     365 </span><span class="lineCov">         43 :           case 'x': c = readhexaesc(ls); goto read_save;</span>
<span class="lineNum">     366 </span><span class="lineCov">          1 :           case '\n': case '\r':</span>
<span class="lineNum">     367 </span><span class="lineCov">          1 :             inclinenumber(ls); c = '\n'; goto only_save;</span>
<span class="lineNum">     368 </span><span class="lineCov">         36 :           case '\\': case '\&quot;': case '\'':</span>
<span class="lineNum">     369 </span><span class="lineCov">         36 :             c = ls-&gt;current; goto read_save;</span>
<span class="lineNum">     370 </span><span class="lineCov">          1 :           case EOZ: goto no_save;  /* will raise an error next loop */</span>
<span class="lineNum">     371 </span><span class="lineCov">          2 :           case 'z': {  /* zap following span of spaces */</span>
<span class="lineNum">     372 </span><span class="lineCov">          2 :             next(ls);  /* skip the 'z' */</span>
<span class="lineNum">     373 </span><span class="lineCov">          8 :             while (lisspace(ls-&gt;current)) {</span>
<span class="lineNum">     374 </span><span class="lineCov">          6 :               if (currIsNewline(ls)) inclinenumber(ls);</span>
<span class="lineNum">     375 </span><span class="lineCov">          5 :               else next(ls);</span>
<span class="lineNum">     376 </span>            :             }
<span class="lineNum">     377 </span><span class="lineCov">          2 :             goto no_save;</span>
<span class="lineNum">     378 </span>            :           }
<span class="lineNum">     379 </span><span class="lineCov">         64 :           default: {</span>
<span class="lineNum">     380 </span><span class="lineCov">         64 :             if (!lisdigit(ls-&gt;current))</span>
<span class="lineNum">     381 </span><span class="lineCov">          1 :               escerror(ls, &amp;ls-&gt;current, 1, &quot;invalid escape sequence&quot;);</span>
<span class="lineNum">     382 </span>            :             /* digital escape \ddd */
<span class="lineNum">     383 </span><span class="lineCov">         63 :             c = readdecesc(ls);</span>
<span class="lineNum">     384 </span><span class="lineCov">         62 :             goto only_save;</span>
<span class="lineNum">     385 </span>            :           }
<span class="lineNum">     386 </span>            :         }
<span class="lineNum">     387 </span><span class="lineCov">        360 :        read_save: next(ls);  /* read next character */</span>
<span class="lineNum">     388 </span><span class="lineCov">        423 :        only_save: save(ls, c);  /* save 'c' */</span>
<span class="lineNum">     389 </span><span class="lineCov">        426 :        no_save: break;</span>
<span class="lineNum">     390 </span>            :       }
<span class="lineNum">     391 </span><span class="lineCov">      67703 :       default:</span>
<span class="lineNum">     392 </span><span class="lineCov">      67703 :         save_and_next(ls);</span>
<span class="lineNum">     393 </span>            :     }
<span class="lineNum">     394 </span>            :   }
<span class="lineNum">     395 </span><span class="lineCov">       6429 :   save_and_next(ls);  /* skip delimiter */</span>
<span class="lineNum">     396 </span><span class="lineCov">      12858 :   seminfo-&gt;ts = luaX_newstring(ls, luaZ_buffer(ls-&gt;buff) + 1,</span>
<span class="lineNum">     397 </span><span class="lineCov">       6429 :                                    luaZ_bufflen(ls-&gt;buff) - 2);</span>
<span class="lineNum">     398 </span><span class="lineCov">       6429 : }</span>
<span class="lineNum">     399 </span>            : 
<span class="lineNum">     400 </span>            : 
<span class="lineNum">     401 </span><span class="lineCov">      87499 : static int llex (LexState *ls, SemInfo *seminfo) {</span>
<span class="lineNum">     402 </span><span class="lineCov">      87499 :   luaZ_resetbuffer(ls-&gt;buff);</span>
<span class="lineNum">     403 </span>            :   for (;;) {
<span class="lineNum">     404 </span><span class="lineCov">     235271 :     switch (ls-&gt;current) {</span>
<span class="lineNum">     405 </span><span class="lineCov">      20342 :       case '\n': case '\r': {  /* line breaks */</span>
<span class="lineNum">     406 </span><span class="lineCov">      20342 :         inclinenumber(ls);</span>
<span class="lineNum">     407 </span><span class="lineCov">      20342 :         break;</span>
<span class="lineNum">     408 </span>            :       }
<span class="lineNum">     409 </span><span class="lineCov">     125074 :       case ' ': case '\f': case '\t': case '\v': {  /* spaces */</span>
<span class="lineNum">     410 </span><span class="lineCov">     125074 :         next(ls);</span>
<span class="lineNum">     411 </span><span class="lineCov">     125074 :         break;</span>
<span class="lineNum">     412 </span>            :       }
<span class="lineNum">     413 </span><span class="lineCov">       2645 :       case '-': {  /* '-' or '--' (comment) */</span>
<span class="lineNum">     414 </span><span class="lineCov">       2645 :         next(ls);</span>
<span class="lineNum">     415 </span><span class="lineCov">       2645 :         if (ls-&gt;current != '-') return '-';</span>
<span class="lineNum">     416 </span>            :         /* else is a comment */
<span class="lineNum">     417 </span><span class="lineCov">       2357 :         next(ls);</span>
<span class="lineNum">     418 </span><span class="lineCov">       2357 :         if (ls-&gt;current == '[') {  /* long comment? */</span>
<span class="lineNum">     419 </span><span class="lineCov">        434 :           int sep = skip_sep(ls);</span>
<span class="lineNum">     420 </span><span class="lineCov">        434 :           luaZ_resetbuffer(ls-&gt;buff);  /* `skip_sep' may dirty the buffer */</span>
<span class="lineNum">     421 </span><span class="lineCov">        434 :           if (sep &gt;= 0) {</span>
<span class="lineNum">     422 </span><span class="lineCov">        434 :             read_long_string(ls, NULL, sep);  /* skip long comment */</span>
<span class="lineNum">     423 </span><span class="lineCov">        433 :             luaZ_resetbuffer(ls-&gt;buff);  /* previous call may dirty the buff. */</span>
<span class="lineNum">     424 </span><span class="lineCov">        433 :             break;</span>
<span class="lineNum">     425 </span>            :           }
<span class="lineNum">     426 </span>            :         }
<span class="lineNum">     427 </span>            :         /* else short comment */
<span class="lineNum">     428 </span><span class="lineCov">      38177 :         while (!currIsNewline(ls) &amp;&amp; ls-&gt;current != EOZ)</span>
<span class="lineNum">     429 </span><span class="lineCov">      36254 :           next(ls);  /* skip until end of line (or end of file) */</span>
<span class="lineNum">     430 </span><span class="lineCov">       1923 :         break;</span>
<span class="lineNum">     431 </span>            :       }
<span class="lineNum">     432 </span><span class="lineCov">        805 :       case '[': {  /* long string or simply '[' */</span>
<span class="lineNum">     433 </span><span class="lineCov">        805 :         int sep = skip_sep(ls);</span>
<span class="lineNum">     434 </span><span class="lineCov">        805 :         if (sep &gt;= 0) {</span>
<span class="lineNum">     435 </span><span class="lineCov">        149 :           read_long_string(ls, seminfo, sep);</span>
<span class="lineNum">     436 </span><span class="lineCov">        148 :           return TK_STRING;</span>
<span class="lineNum">     437 </span>            :         }
<span class="lineNum">     438 </span><span class="lineCov">        656 :         else if (sep == -1) return '[';</span>
<span class="lineNum">     439 </span><span class="lineCov">          1 :         else lexerror(ls, &quot;invalid long string delimiter&quot;, TK_STRING);</span>
<span class="lineNum">     440 </span>            :       }
<span class="lineNum">     441 </span><span class="lineCov">       4130 :       case '=': {</span>
<span class="lineNum">     442 </span><span class="lineCov">       4130 :         next(ls);</span>
<span class="lineNum">     443 </span><span class="lineCov">       4130 :         if (ls-&gt;current != '=') return '=';</span>
<span class="lineNum">     444 </span><span class="lineCov">        389 :         else { next(ls); return TK_EQ; }</span>
<span class="lineNum">     445 </span>            :       }
<span class="lineNum">     446 </span><span class="lineCov">         83 :       case '&lt;': {</span>
<span class="lineNum">     447 </span><span class="lineCov">         83 :         next(ls);</span>
<span class="lineNum">     448 </span><span class="lineCov">         83 :         if (ls-&gt;current != '=') return '&lt;';</span>
<span class="lineNum">     449 </span><span class="lineCov">         39 :         else { next(ls); return TK_LE; }</span>
<span class="lineNum">     450 </span>            :       }
<span class="lineNum">     451 </span><span class="lineCov">        173 :       case '&gt;': {</span>
<span class="lineNum">     452 </span><span class="lineCov">        173 :         next(ls);</span>
<span class="lineNum">     453 </span><span class="lineCov">        173 :         if (ls-&gt;current != '=') return '&gt;';</span>
<span class="lineNum">     454 </span><span class="lineCov">        137 :         else { next(ls); return TK_GE; }</span>
<span class="lineNum">     455 </span>            :       }
<span class="lineNum">     456 </span><span class="lineCov">        237 :       case '~': {</span>
<span class="lineNum">     457 </span><span class="lineCov">        237 :         next(ls);</span>
<span class="lineNum">     458 </span><span class="lineCov">        237 :         if (ls-&gt;current != '=') return '~';</span>
<span class="lineNum">     459 </span><span class="lineCov">        237 :         else { next(ls); return TK_NE; }</span>
<span class="lineNum">     460 </span>            :       }
<span class="lineNum">     461 </span><span class="lineCov">        491 :       case ':': {</span>
<span class="lineNum">     462 </span><span class="lineCov">        491 :         next(ls);</span>
<span class="lineNum">     463 </span><span class="lineCov">        491 :         if (ls-&gt;current != ':') return ':';</span>
<span class="lineNum">     464 </span><span class="lineCov">         16 :         else { next(ls); return TK_DBCOLON; }</span>
<span class="lineNum">     465 </span>            :       }
<span class="lineNum">     466 </span><span class="lineCov">       6437 :       case '&quot;': case '\'': {  /* short literal strings */</span>
<span class="lineNum">     467 </span><span class="lineCov">       6437 :         read_string(ls, ls-&gt;current, seminfo);</span>
<span class="lineNum">     468 </span><span class="lineCov">       6429 :         return TK_STRING;</span>
<span class="lineNum">     469 </span>            :       }
<span class="lineNum">     470 </span><span class="lineCov">       3862 :       case '.': {  /* '.', '..', '...', or number */</span>
<span class="lineNum">     471 </span><span class="lineCov">       3862 :         save_and_next(ls);</span>
<span class="lineNum">     472 </span><span class="lineCov">       3862 :         if (check_next(ls, &quot;.&quot;)) {</span>
<span class="lineNum">     473 </span><span class="lineCov">       1864 :           if (check_next(ls, &quot;.&quot;))</span>
<span class="lineNum">     474 </span><span class="lineCov">         37 :             return TK_DOTS;   /* '...' */</span>
<span class="lineNum">     475 </span><span class="lineCov">       1827 :           else return TK_CONCAT;   /* '..' */</span>
<span class="lineNum">     476 </span>            :         }
<span class="lineNum">     477 </span><span class="lineCov">       1998 :         else if (!lisdigit(ls-&gt;current)) return '.';</span>
<span class="lineNum">     478 </span>            :         /* else go through */
<span class="lineNum">     479 </span>            :       }
<span class="lineNum">     480 </span>            :       case '0': case '1': case '2': case '3': case '4':
<span class="lineNum">     481 </span>            :       case '5': case '6': case '7': case '8': case '9': {
<span class="lineNum">     482 </span><span class="lineCov">       3093 :         read_numeral(ls, seminfo);</span>
<span class="lineNum">     483 </span><span class="lineCov">       3092 :         return TK_NUMBER;</span>
<span class="lineNum">     484 </span>            :       }
<span class="lineNum">     485 </span><span class="lineCov">        463 :       case EOZ: {</span>
<span class="lineNum">     486 </span><span class="lineCov">        463 :         return TK_EOS;</span>
<span class="lineNum">     487 </span>            :       }
<span class="lineNum">     488 </span><span class="lineCov">      67437 :       default: {</span>
<span class="lineNum">     489 </span><span class="lineCov">      67437 :         if (lislalpha(ls-&gt;current)) {  /* identifier or reserved word? */</span>
<span class="lineNum">     490 </span>            :           TString *ts;
<span class="lineNum">     491 </span>            :           do {
<span class="lineNum">     492 </span><span class="lineCov">     166454 :             save_and_next(ls);</span>
<span class="lineNum">     493 </span><span class="lineCov">     166454 :           } while (lislalnum(ls-&gt;current));</span>
<span class="lineNum">     494 </span><span class="lineCov">      39271 :           ts = luaX_newstring(ls, luaZ_buffer(ls-&gt;buff),</span>
<span class="lineNum">     495 </span><span class="lineCov">      39271 :                                   luaZ_bufflen(ls-&gt;buff));</span>
<span class="lineNum">     496 </span><span class="lineCov">      39271 :           seminfo-&gt;ts = ts;</span>
<span class="lineNum">     497 </span><span class="lineCov">      39271 :           if (isreserved(ts))  /* reserved word? */</span>
<span class="lineNum">     498 </span><span class="lineCov">      13213 :             return ts-&gt;tsv.extra - 1 + FIRST_RESERVED;</span>
<span class="lineNum">     499 </span>            :           else {
<span class="lineNum">     500 </span><span class="lineCov">      26058 :             return TK_NAME;</span>
<span class="lineNum">     501 </span>            :           }
<span class="lineNum">     502 </span>            :         }
<span class="lineNum">     503 </span>            :         else {  /* single-char tokens (+ - / ...) */
<span class="lineNum">     504 </span><span class="lineCov">      28166 :           int c = ls-&gt;current;</span>
<span class="lineNum">     505 </span><span class="lineCov">      28166 :           next(ls);</span>
<span class="lineNum">     506 </span><span class="lineCov">      28166 :           return c;</span>
<span class="lineNum">     507 </span>            :         }
<span class="lineNum">     508 </span>            :       }
<span class="lineNum">     509 </span>            :     }
<span class="lineNum">     510 </span>            :   }
<span class="lineNum">     511 </span>            : }
<span class="lineNum">     512 </span>            : 
<span class="lineNum">     513 </span>            : 
<span class="lineNum">     514 </span><span class="lineCov">      87499 : void luaX_next (LexState *ls) {</span>
<span class="lineNum">     515 </span><span class="lineCov">      87499 :   ls-&gt;lastline = ls-&gt;linenumber;</span>
<span class="lineNum">     516 </span><span class="lineCov">      87499 :   if (ls-&gt;lookahead.token != TK_EOS) {  /* is there a look-ahead token? */</span>
<span class="lineNum">     517 </span><span class="lineCov">        445 :     ls-&gt;t = ls-&gt;lookahead;  /* use this one */</span>
<span class="lineNum">     518 </span><span class="lineCov">        445 :     ls-&gt;lookahead.token = TK_EOS;  /* and discharge it */</span>
<span class="lineNum">     519 </span>            :   }
<span class="lineNum">     520 </span>            :   else
<span class="lineNum">     521 </span><span class="lineCov">      87054 :     ls-&gt;t.token = llex(ls, &amp;ls-&gt;t.seminfo);  /* read next token */</span>
<span class="lineNum">     522 </span><span class="lineCov">      87487 : }</span>
<span class="lineNum">     523 </span>            : 
<span class="lineNum">     524 </span>            : 
<span class="lineNum">     525 </span><span class="lineCov">        445 : int luaX_lookahead (LexState *ls) {</span>
<span class="lineNum">     526 </span>            :   lua_assert(ls-&gt;lookahead.token == TK_EOS);
<span class="lineNum">     527 </span><span class="lineCov">        445 :   ls-&gt;lookahead.token = llex(ls, &amp;ls-&gt;lookahead.seminfo);</span>
<span class="lineNum">     528 </span><span class="lineCov">        445 :   return ls-&gt;lookahead.token;</span>
<span class="lineNum">     529 </span>            : }
<span class="lineNum">     530 </span>            : 
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.13</a></td></tr>
  </table>
  <br>

</body>
</html>
